1. Field of the Invention
The present invention relates to a variable length coded data processing method and a device for performing the same method and, particularly, to a variable length coded data processing method for connecting a plurality of variable length coded data and coding them and a device performing the same method.
2. Description of the Prior Art
The MPEG (Moving Picture Coding Experts Group) system is a typical example of systems for variable length coding an information. In the MPEG, a coded bit stream in a case of a video signal has an amount of variable length code every picture. The reasons for this are that the MPEG uses information transformation such as discrete cosine transform (DCT), quantization and Huffman coding and that entropy of the coded picture itself is substantially changed since an input image is coded as it is in some case and a differential picture which is a difference between an input picture and a predicted picture is coded in other cases, due to the fact that, in order to improve the picture quality, it is necessary to adaptively change the amount of code delivered to every picture and since a motion compensation prediction is performed.
FIG. 12 shows an example of a coded bit stream according to the MPEG and it is transmitted in a sequence of I picture (intra-frame coded picture), P picture (inter-frame forward predictive coded picture), and B picture (bidirectional predictive coded picture). In this description, the I picture is, for example, 120 kbits, the P picture 80 kbits and the B picture 40 kbits, and they are variable length code amounts.
In a case where such variable length data is coded at a fixed transfer rate (coding rate), assuming that the maximum value of a buffer amount of a decoder is set as shown in FIG. 13, it is defined in the MPEG that a virtual decoder model which receives data at a constant rate and, when the data reaches a predetermined value, performs a decoding in a moment within a predetermined time unit (for a video signal of the NTSC system, 1/29.97 seconds) is connected to an output of a coder and the coding is performed such that the buffer neither overflow nor underflow.
In FIG. 13, capital letter I, B and P depict the I picture (intra-frame coded picture), the B picture (inter-frame forward predictive coded picture) and the P picture (bi-directional predictive coded picture) standardized by MPEG. These pictures are accumulated in the buffer and each is decoded in the time unit of 1/29.97 seconds and the data thereof in the buffer is erased in a moment.
This technique is called as VBV (Video Buffering Verifier) and is described in detail in ISO-11172-2 and IS0138818-2 by the International Organization for Standardization (ISO). According to this standard, the data transfer rate in the VBV buffer becomes a fixed rate when a monitoring time is long enough, although the transfer rate in the VBV buffer varies locally, and the MPEG defines this transfer rate as fixed transfer rate.
When there are a plurality of video data signals which are variable length coded by the compression coding system of the MPEG in screen unit and a user reproduces them in an arbitrary sequence or in a predetermined sequence (for example, when background moving images of a "Karaoke" are displayed in various combinations or when various images for propaganda are displayed in various combinations), it is necessary to couple or connect two video data signals. These video data signals will be referred to as video data signals #1 and #2, respectively.
In order to couple the video data signals #1 and #2 without the overflow and underflow of the VBV buffer, it is necessary that the video data signal #1 is coded first in time and, as shown in FIG. 14, an occupancy of the VBV buffer of the picture of the video data signal #1 at an end time of the video data signal #1 is taken over to an occupancy of a header picture of the video data signal #2 which is to be coded next such that the buffer occupancies become the same in the coupled portion (shown by white circles in FIG. 14).
Therefore, in the conventional variable length coded data processing method in which two video data signals are coupled or connected, it is necessary to preliminarily code them by taking the sequence of combination of the two data signals into consideration. Therefore, it is impossible to couple two video data signals which have been coded randomly. If such randomly coded two video data signals are simply combined, there may be the following problems:
First, it is assumed that a time shift of the occupancy of the VBV buffer of data of two video data signals #1 and #2 which are coded without considering a case where they are coupled as a first pattern becomes as shown in FIG. 15(A). According to this assumption, the buffer occupancies of initial pictures of the video data signals #1 and #2 are common values a, unlike that shown in FIG. 14. When these video data signals #1 and #2 are coupled, it is necessary to make the buffer occupancy of the initial picture of the video data signal #2 to be decoded to b since the buffer occupancy of the video data signal #1 at the end thereof is b as shown in FIG. 15(B) and, therefore, the buffer occupancy of the video data signal #2 is shifted down by (a-b) as a whole. Therefore, there is an underflow in a section shown by I in FIG. 15(B).
Then, it is assumed that a time shift of the occupancy of the VBV buffer of data of two video data signals #1 and #2 which are coded without considering a case where they are coupled as a second pattern becomes as shown in FIG. 16(A). According to this assumption, the buffer occupancies of header pictures of the video data signals #1 and #2 are common values a, unlike that shown in FIG. 14, similarly. When these video data signals #1 and #2 are coupled, it is necessary to make the buffer occupancy of the head picture of the video data signal #2 to be decoded to the maximum value c since the buffer occupancy of the video data signal #1 at the end thereof is the maximum value c as shown in FIG. 16(B) and, therefore, the buffer occupancy of the video data signal #2 is shifted up by (c-a) as a whole and there is an overflow in a section shown by II in FIG. 16(B).
The production of such underflow or overflow is due to that the video data signal #1 is coded without considering the coupling of the buffer occupancy of the head picture of the video data signal #2 to be coded next to the buffer occupancy of the last picture of the video data signal #1. Therefore, there may be a strong possibility that such underflow or overflow similarly occurs in coupling one of the subsequent video data signals to the second video data signal to another.
The term "underflow" means that, at a time when a picture is decoded by the reproducing device, data of the picture is not arrived thereat. Therefore, in such case, it is general to wait for a decoding the second video data signal until a whole data of the second video signal becomes available by, for example, reproducing a preceding video data signal again, that is, freezing the preceding video data signal, that is, the first video data signal, although this may depend upon a construction of the reproducing device.
On the other hand, the term "overflow" means that, when the buffer of the reproducing device is overflowed, data overflowed is lost. Generally, Huffman coding is employed in the MPEG and, if a portion of picture data is lost, the whole picture thereof may be lost.
Further, since the motion compensation prediction is performed, a picture to be predicted by referring to the picture may be lost not only within the display screen but also in a time direction.